#include "gd32f10x.h"
#include "systick.h"
#include <stdio.h>
#include "main.h"
#include "led.h"
#include "delay.h"
#include "key.h"
#include "exti.h"

/*!
    \brief      main function
    \param[in]  none
    \param[out] none
    \retval     none
*/

int main(void)
{
    //    /* configure systick */
    //    systick_config();
    LED_Init();
    KEY_A_Init();
    Exti_Init();
    while (1)
    {
        delay_ms(3000);
        if (KEY_A_Pressed())
        {
            LED1_Toggle();
        }
    }
}

/* retarget the C library printf function to the USART */
int fputc(int ch, FILE *f)
{
    //    usart_data_transmit(EVAL_COM0, (uint8_t)ch);
    //    while(RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE));

    return ch;
}
